package com.edu.whty.service.base;

import com.edu.whty.entity.base.CommonPraise;
import com.edu.whty.entity.base.UserExamFlag;

import java.util.List;
import java.util.Map;

/**
 * 定义各个模块公共的Service
 * 
 * @author shijiapeng
 * @date 2016年3月25日 下午5:25:58
 */
public interface CommonService {
	
	/** 共享资源 */
	public static String BUSINESS_TYPE_SHARE_RESOURCE = "1";
	/** 精品资源 */
	public static String BUSINESS_TYPE_EXCELLENT_RESOURCE = "2";
	/** 共享课件 */
	public static String BUSINESS_TYPE_SHARE_PREPARATION = "3";
	/** 精品课件 */
	public static String BUSINESS_TYPE_EXCELLENT_PREPARATION = "4";
	/** 教育云资源 */
	public static String BUSINESS_TYPE_EDU_RESOURCE = "5";
	/** 我的课堂 */
	public static String BUSINESS_TYPE_MY_CLASSROOM = "6";
	
	/** 学科资源 */
	public static String BUSINESS_TYPE_XUEKE_RESOURCE = "7";
	
	/** 校本资源 */
	public static String THE_SCHOOL_RESOURCE = "9";
	
	/**一师优课*/
	public static String BUSINESS_TYPE_YSYK_RESOURCE = "11";
	
	/**课时包资源*/
	public static String BUSINESS_TYPE_KSB_RESOURCE = "13";
	
	/**共享导学*/
	public static String BUSINESS_TYPE_SHARE_GUIDANCE ="20";
	/**精品导学*/
	public static String BUSINESS_TYPE_EXCELLENT_GUIDANCE = "21";
	/**已推送导学*/
	public static String BUSINESS_TYPE_PUSH_GUIDANCE = "22";
	
	/** 新业务类型规则，编号采用双数：10 教材资源 20 导学 30课件  40 课堂 50 检测 */
	/** 共享习题 */
	public static String BUSINESS_TYPE_SHARE_QUESTION = "51";
	/** 精品习题 */
	public static String BUSINESS_TYPE_EXCLLENT_QUESTION = "52";
	/** 海马资源 **/
	public static String BUSINESS_TYPE_HM_RESOURCE = "12";
	/**
	 * 修改业务平均评分，比如修改共享资源评分
	 * @param businessType 业务对象类型
	 * @param businessType 业务对象ID
	 * @param newScore 用户评分
	 * @throws Exception
	 */
	public void updateAvgScore(String businessType, String businessId, int newScore
            , String periodId, String subjectId, String userId, String netIp) throws Exception;

	/**
	 * @category 点赞
	 * @param param
	 * @throws Exception
	 */
	public void addPraise(CommonPraise p) throws Exception;
	/**
	 * @category 取消点赞
	 * @param param
	 * @throws Exception
	 */
	public void deletePraise(CommonPraise p) throws Exception;
	/**
	 * @category 是否点赞过
	 * @param param
	 * @throws Exception
	 */
	public boolean hasPraise(Map<String, Object> param)throws Exception;
	/**
	 * @category 查询点赞数量
	 * @param param
	 * @throws Exception
	 */
	public Integer getPraiseCount(CommonPraise p)throws Exception;
	
	/**
	 * @category 查询点赞数量
	 * @param param
	 * @throws Exception
	 */
	public Integer getPraiseCountClass(CommonPraise p)throws Exception;
	/**
	 * 点赞详情
	 * @param param
	 * @return
	 * @throws Exception
	 */
	public List<CommonPraise> praiseDetail(Map<String, Object> param) throws Exception ;

	/**
	 * 获取用户慧学检测开关
	 * @param userRequest
	 * @return
	 */
	public UserExamFlag getUserExamFlag(UserExamFlag userRequest);

	/**
	 * 更新慧学检测开关
	 * @param userRequest
	 * @return 
	 */
	public UserExamFlag updateUserExamFlag(UserExamFlag userRequest);

}
